# -*- coding: utf-8 -*-

import json

class ObjEncoder(json.JSONEncoder):
    def default(self,obj):
        #convert object to a dict
        d = {}
        d.update(obj.__dict__)
        return d
